#!/usr/bin/env python3
"""
脚本名称：ch41_exe.py
功能描述：演示 类的继承
作者：Gavin
创建日期：2022-05-06
版本：1.0
依赖库：无
使用方法： python ch41_exe.py
"""


# Animal is-a object (yes, sort of confusing) look at the extra credit
class Animal(object):
    pass


class Dog(Animal):
    def __init__(self, name):
        self.name = name


class Cat(Animal):
    def __init__(self, name):
        self.name = name


class Person(object):
    def __init__(self, name):
        self.name = name
        # Person has-a pet of some kind
        self.pet = None


class Employee(Person):
    def __init__(self, name, salary):
        # hmm what is this strange magic?
        super(Employee, self).__init__(name)
        self.salary = salary


class Fish(object):
    pass


class Salmon(Fish):
    pass


class Halibut(Fish):
    pass


# rover is-a Dog
rover = Dog("Rover")
satan = Cat("Satan")
mary = Person("Mary")
